package com.alisls.shequtao.service.goods.service.impl;

import com.alisls.shequtao.service.goods.dao.SpuDetailDAO;
import com.alisls.shequtao.service.goods.dto.SpuDetailDTO;
import com.alisls.shequtao.service.goods.entity.SpuDetailDO;
import com.alisls.shequtao.service.goods.service.SpuDetailService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

/**
 * 商品详细服务
 *
 * @author Ke Wang
 */
@Service("spuDetailService")
@AllArgsConstructor
@Slf4j
public class SpuDetailServiceImpl extends ServiceImpl<SpuDetailDAO, SpuDetailDO>
        implements SpuDetailService {

    @Override
    public SpuDetailDTO convertToDTO(SpuDetailDO spuDetailDO) {
        SpuDetailDTO spuDetailDTO = new SpuDetailDTO();
        BeanUtils.copyProperties(spuDetailDO, spuDetailDTO);
        return spuDetailDTO;
    }

    @Override
    public SpuDetailDO convertToDO(SpuDetailDTO spuDetailDTO) {
        SpuDetailDO spuDetailDO = new SpuDetailDO();
        BeanUtils.copyProperties(spuDetailDTO, spuDetailDO);
        return spuDetailDO;
    }

}
